package think.thread.deadlock.c01;

public class Chopstick {
	private boolean taken=false;
	public synchronized void take() throws Exception{
		while(taken){
			wait();
		}
		taken=true;
	}
	
	public synchronized void drop() throws Exception{
		taken=false;
		notifyAll();
	}
}
